package com.wty.design.structural.composite;

/**
 * @Author wangtengyu
 * @Create 2018-09-19-15:20
 */
public class Test {

    public static void main(String[] args) {
        CatalogComponent imoocCatalog=new CourseCatalog("慕课网课程主目录",1);

        CatalogComponent windowCourse=new Course("windows课程",1);
        CatalogComponent linuxCourse=new Course("linux课程",1);
        CatalogComponent macCourse=new Course("mac课程",1);


        CatalogComponent javaCatalog=new CourseCatalog("java课程目录",2);
        CatalogComponent javaBasicCourse=new Course("java基础",12);
        CatalogComponent javaWebCourse=new Course("javaWeb",20);

        javaCatalog.add(javaBasicCourse);
        javaCatalog.add(javaWebCourse);

        imoocCatalog.add(windowCourse);
        imoocCatalog.add(linuxCourse);
        imoocCatalog.add(macCourse);
        imoocCatalog.add(javaCatalog);

        imoocCatalog.print();





    }
}
